using UnityEngine;
using System.Collections;

public class cRacingStatusGUI : MonoBehaviour {
	
	public Rect TimeRect = new Rect( 0, 0, 120 , 19 );
	public Rect LabRect = new Rect( 0, 20, 60 , 19 );
	public Rect LastLabRect = new Rect( 0, 40, 220 , 19 );
	
	float gameTimeRemaining;
	// Use this for initialization
	void Start () {
		gameTimeRemaining = 0;
	}
	
	// Update is called once per frame
	void Update () {
		gameTimeRemaining += Time.deltaTime;
	}
	
	void OnGUI()
	{
	
		GameObject foundObj = GameObject.Find("TrackChecker" );
		if ( foundObj )
		{
			cTrackChecker tc = (cTrackChecker)foundObj.GetComponent("cTrackChecker");
			
			string text;
			text = string.Format( "{0:00}:{1:00}", (int)( tc.LabTime / 60.0f ), (int)( tc.LabTime % 60.0f) );
			GUI.TextArea( TimeRect, text );
			GUI.TextArea( LabRect, "Lab : " + tc.LabCounter );
			
			if ( tc.LastLabTime > 0f )
			{
				
				text = string.Format( "{0:00}:{1:00}", (int)( tc.LastLabTime / 60.0f ), (int)( tc.LastLabTime % 60.0f) );
				GUI.TextArea( LastLabRect, "Last Time Lab" + text );
				
			}
			
//        	gameMessageLabel = "Time left: " + text;
		}
		
	}
	
}
